Gradle is a large open-source project. The size and scope of the system necessitates the need for a clear way for new developers to the project to contribute to Gradle while ensuring that they can understand the code and make sure their changes will not have a butterfly effect on the rest of the code base.
The Development view focuses on several concerns: module organization, common processing, standardization of design, standardization of testing, instumentation, and codeline organization, as well as developer, production engineer and tester concerns.
Because of Gradle's modular design, this view is focused on the module, codeline organization and common processing concerns and how Gradle's source code is structured in order to ensure a good separation between modules.
This view will be of particular interest to developers looking to contribute to gradle as an open-source project but also for IDE developers who need to understand its structure and functionality. Additionally, it may be helpful to developers who will use gradle to better understand how to exploit its features.
The modules are organized into layers that group together modules which colaborate to perform a single functionality. An incoming arrow into a layer means that the layer uses the incoming module layer. Some layers share bidirectional arrows such as build and core.
Since Gradle is bootstapped, the modules are organized as subprojects of the gradle project. This allows for developers to easily add functionality to gradle by adding subprojects to the gradle project.
Runtime Support Layer: The modules in runtime support layer can be consider as basic components to run Gradle. The modules' names start with 'base' provide some tasks and conventions that are common to most builds and add a structure to the build which will promotes consistency. The modules' names start with 'worker' will allow the running of pieces of work in the background. The other modules will provide support of java Virtual Machine, java process and the use of cache.
File Layer: The modules in file layer will allow Gradle to interact with files like source files, file dependencies, reports and so on in an easy way.
Core Layer: The core layer contains Gradle’s Project API. The Project API is available from build files and made up of 2 main interfaces: Project and Task. Project interface is main API we use to interact with Gradle. We can access all features of Gradle through this interface. Each task belongs to a project, the Task interface allows us to access each task instances.
Build Layer: The modules in build layer are responsible for initializing plugins and tasks, also allowing plugins to receive information about the operations during a build. Some modules’ names contain 'build cache' which means they are responsible for a cache mechanism that aim to save time by reusing outputs produced by other builds. So, it can allow builds to fetch these outputs from cache when the inputs not change.
Plugins Layer: The modules in plugins layer are responsible for managing plugin resolution and use, also assist with plugin development.
Utility Layer: The modules in utility are responsible for launching Gradle, the Gradle command-line interface, doing composite-builds, the execution of command, producing report after each build, and dependency-management.
Test Layer: The modules in test layer are responsible for testing. It contains Junit specific testing classes and support for general test suit. It also contains a library called 'test kit' that can help test plugins and build logic.
Gradle uses several common designs including an extensive use of interfaces and a microkernal design pattern best exemplified through the integration of functionality in the form of plugins. Plugins can be built by third parties or the gradle team itself (although since gradle is open-source there is a bit of a grey line here). Additionally, most of the key parametric information for the gradle project is stored in the gradle.build file.
Gradle is a complex muiltilayered build integration tool that is rendered all the more complicated by its bootstrapped design. This model is designed to help make sense of its code and structure.
It is worth noting however, that this model focuses on the code structure pre-compilation. For each release gradle is complied using gradle, and thus the code structure will significantly change.
The source code is on GitHub. When someone wishes to contribute to Gradle, a new branch needs is created with a suitable name: developer name/project. After the changes are submitted, one of the core developers will review the pull request and make a decision on it. More information can be found here.
Anyone who contributes to Gradle must also adhere to the Gradle Code of Conduct.